package cn.com.blueInfo.bpm.person.convert;

import cn.com.blueInfo.bpm.common.convert.BaseConvert;
import cn.com.blueInfo.bpm.person.entity.UserBase;
import cn.com.blueInfo.bpm.person.request.UserBaseDTO;
import cn.com.blueInfo.bpm.person.response.UserBaseVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

/**
 * 员工基本信息表 对象转换
 * @author suxch
 * @since 2025-08-31 16:18:02
 */
@Mapper(componentModel = "spring")
public interface UserBaseConvert
        extends BaseConvert<UserBase, UserBaseDTO, UserBaseVO> {

    UserBase dtoToEntity(UserBaseDTO dto);

    UserBase dtoToEntity(UserBaseDTO.UpdatePartialDTO updatePartialDTO);

    @Mapping(source = "status", target = "status", qualifiedByName = "enumToDesc")
    @Mapping(source = "deleted", target = "deleted", qualifiedByName = "enumToDesc")
    @Mapping(source = "education", target = "education", qualifiedByName = "enumToDesc")
    @Mapping(source = "employmentType", target = "employmentType", qualifiedByName = "enumToDesc")
    @Mapping(source = "identityType", target = "identityType", qualifiedByName = "enumToDesc")
    @Mapping(source = "sex", target = "sex", qualifiedByName = "enumToDesc")
    @Mapping(source = "userStatus", target = "userStatus", qualifiedByName = "enumToDesc")
    UserBaseVO entityToVO(UserBase entity);

}